﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Master/Site_InnerWeb.master" AutoEventWireup="false"
    ValidateRequest="false" CodeFile="MyContent.aspx.vb" Inherits="private_secure_members_manage_MyContent" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <script src="../../../Scripts/jquery-1.3.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/jquery.tablednd_0_5.js" type="text/javascript"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            // <span class="comment">// Initialise the table</span>
            // $('#MainContent_GridView3').ta.tableDnD();
            //$('#MainContent_GridView3').tableDnD();
        });

    </script>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 445px;
        }
        .style3
        {
            width: 339px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>
        Manage My Message Content</h2>
    <h3>
        Define the Messages your Recipients Receive</h3>
    <hr />
    <table id="table1" class="style1">
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td class="style2">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="top">
                Choose an Organisation/Business:
            </td>
            <td>
                &nbsp;
            </td>
            <td class="style2">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="top">
                <asp:DropDownList ID="ddlEntity" runat="server" DataSourceID="SqlEntity_ds" DataTextField="Name"
                    DataValueField="ID" Width="200px" AutoPostBack="True" AppendDataBoundItems="True">
                    <asp:ListItem Value="0">Please Select ...</asp:ListItem>
                </asp:DropDownList>
                &nbsp;
                <asp:Button ID="Button2" runat="server" Text="Add Content" CausesValidation="false" />
        <asp:Button ID="Button10" runat="server" Text="Cancel" CausesValidation="false"/>
                &nbsp;<asp:SqlDataSource ID="SqlEntity_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                    SelectCommand="usp_GetEntityList_ByPersonId" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:Parameter Name="PersonId" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;
            </td>
            <td class="style2">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="3">
                Create groups of messages for use in your future campaigns. Each group must have a name. (NB: To delete a message group you must first remove all messages in that group). Message groups can be reused so there is little reason to delete a Message Group.</td>
        </tr>
        <tr>
            <td valign="top" colspan="3">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                    HtmlEncode="false" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="SqlUserMessageGroup_ds"
                    Width="66%" EmptyDataText="You have no saved messages so far. Click the &lt;b&gt;Add Content&lt;/b&gt; button above to get started. Then either manually add content or add from the System Content Templates "
                    CellPadding="4" ForeColor="#333333">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:TemplateField ShowHeader="False">
                            <EditItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                    Text="Update"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                    Text="Cancel"></asp:LinkButton>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Select"
                                    Text="Select"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="CustomEdit"
                                    Text="Edit" CommandArgument='<%# Bind("Id") %>'></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="Delete"></asp:LinkButton>
                                <asp:ConfirmButtonExtender ID="LinkButton3_ConfirmButtonExtender" runat="server"
                                    ConfirmText="Delete content?" Enabled="True" TargetControlID="LinkButton3">
                                </asp:ConfirmButtonExtender>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="RowNum" HeaderText="#" ReadOnly="True" SortExpression="RowNum" />
                        <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                            SortExpression="Id" Visible="False" />
                        <asp:BoundField DataField="EntityId" HeaderText="EntityId" SortExpression="EntityId"
                            Visible="False" />
                        <asp:BoundField DataField="GroupName" HeaderText="Group Name" SortExpression="GroupName" />
                        <asp:BoundField DataField="Name" HeaderText="Type" SortExpression="Name" />
                        <asp:BoundField DataField="DateAdded" HeaderText="Added" SortExpression="DateAdded" />
                        <asp:TemplateField HeaderText="MessageTypeId" SortExpression="MessageTypeId" Visible="False">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MessageTypeId") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("MessageTypeId") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlUserMessageGroup_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                    SelectCommand="usp_UserSavedMessageGroupSelectByEntityId" SelectCommandType="StoredProcedure"
                    DeleteCommand="usp_UserSavedMessageGroupDelete" DeleteCommandType="StoredProcedure"
                    InsertCommand="usp_UserSavedMessageGroupInsert" InsertCommandType="StoredProcedure"
                    UpdateCommand="usp_UserSavedMessageGroupUpdate" UpdateCommandType="StoredProcedure">
                    <DeleteParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="EntityId" Type="Int32" />
                        <asp:Parameter Name="GroupName" Type="String" />
                        <asp:Parameter Name="MessageTypeId" Type="Byte" />
                        <asp:Parameter Name="DateAdded" Type="DateTime" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlEntity" Name="EntityId" PropertyName="SelectedValue"
                            Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                        <asp:Parameter Name="EntityId" Type="Int32" />
                        <asp:Parameter Name="GroupName" Type="String" />
                        <asp:Parameter Name="MessageTypeId" Type="Byte" />
                        <asp:Parameter Name="DateAdded" Type="DateTime" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                &nbsp;
            </td>
        </tr>
        <%-- <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td class="style2">
                &nbsp;
            </td>
        </tr>--%>
        <tr>
            <td colspan="2">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:Panel ID="Panel2" runat="server">
                            Below are the items for the selected message group above. When messages get sent to your recipients they will receive these messages one at a time in the order you specify below.<br />
                            <br />
                            <asp:Button ID="Button7" runat="server" Text="Add Custom Message" CausesValidation="false" />
                            <asp:Button ID="Button9" runat="server" Text="Predefined Messages" CausesValidation="false" />
                            <br />
                            <br />
                            Use the numbers below to create a sequence in which your messages will be sent. The numbers do not need to be consecutive, just in order.<p />
                            <asp:GridView ID="GridView3" runat="server" DataSourceID="SQLv_UserContentMessageGroupItem_ds"
                                AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" Width="100%"
                                CellPadding="4" ForeColor="#333333" HtmlEncode="false" AllowPaging="True">
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                <Columns>
                                    <asp:TemplateField ShowHeader="False">
                                        <EditItemTemplate>
                                            <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Update"
                                                Text="Update"></asp:LinkButton>
                                            &nbsp;<asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandName="Cancel"
                                                Text="Cancel"></asp:LinkButton>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                                Text="Edit"></asp:LinkButton>
                                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                                Text="Delete"></asp:LinkButton>
                                            <asp:ConfirmButtonExtender ID="LinkButton2_ConfirmButtonExtender" runat="server"
                                                ConfirmText="Delete message?" Enabled="True" TargetControlID="LinkButton2">
                                            </asp:ConfirmButtonExtender>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Id" SortExpression="Id" Visible="False">
                                        <EditItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText=" # " SortExpression="SeqNo">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SeqNo") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList2" runat="server" SelectedValue='<%# Bind("SeqNo") %>'>
                                                <asp:ListItem>1</asp:ListItem>
                                                <asp:ListItem>2</asp:ListItem>
                                                <asp:ListItem>3</asp:ListItem>
                                                <asp:ListItem>4</asp:ListItem>
                                                <asp:ListItem>5</asp:ListItem>
                                                <asp:ListItem>6</asp:ListItem>
                                                <asp:ListItem>7</asp:ListItem>
                                                <asp:ListItem>8</asp:ListItem>
                                                <asp:ListItem>9</asp:ListItem>
                                                <asp:ListItem>10</asp:ListItem>
                                                <asp:ListItem>11</asp:ListItem>
                                                <asp:ListItem>12</asp:ListItem>
                                                <asp:ListItem>13</asp:ListItem>
                                                <asp:ListItem>14</asp:ListItem>
                                                <asp:ListItem>15</asp:ListItem>
                                                <asp:ListItem>16</asp:ListItem>
                                                <asp:ListItem>17</asp:ListItem>
                                                <asp:ListItem>18</asp:ListItem>
                                                <asp:ListItem>19</asp:ListItem>
                                                <asp:ListItem>20</asp:ListItem>
                                                <asp:ListItem>21</asp:ListItem>
                                                <asp:ListItem>22</asp:ListItem>
                                                <asp:ListItem>23</asp:ListItem>
                                                <asp:ListItem>24</asp:ListItem>
                                                <asp:ListItem>25</asp:ListItem>
                                                <asp:ListItem>26</asp:ListItem>
                                                <asp:ListItem>27</asp:ListItem>
                                                <asp:ListItem>28</asp:ListItem>
                                                <asp:ListItem>29</asp:ListItem>
                                                <asp:ListItem>30</asp:ListItem>
                                                <asp:ListItem>31</asp:ListItem>
                                                <asp:ListItem>32</asp:ListItem>
                                                <asp:ListItem>33</asp:ListItem>
                                                <asp:ListItem>34</asp:ListItem>
                                                <asp:ListItem>35</asp:ListItem>
                                                <asp:ListItem>36</asp:ListItem>
                                                <asp:ListItem>37</asp:ListItem>
                                                <asp:ListItem>38</asp:ListItem>
                                                <asp:ListItem>39</asp:ListItem>
                                                <asp:ListItem>40</asp:ListItem>
                                                <asp:ListItem>41</asp:ListItem>
                                                <asp:ListItem>42</asp:ListItem>
                                                <asp:ListItem>43</asp:ListItem>
                                                <asp:ListItem>44</asp:ListItem>
                                                <asp:ListItem>45</asp:ListItem>
                                                <asp:ListItem>46</asp:ListItem>
                                                <asp:ListItem>47</asp:ListItem>
                                                <asp:ListItem>48</asp:ListItem>
                                                <asp:ListItem>49</asp:ListItem>
                                                <asp:ListItem>50</asp:ListItem>
                                                <asp:ListItem>51</asp:ListItem>
                                                <asp:ListItem>52</asp:ListItem>
                                                <asp:ListItem>53</asp:ListItem>
                                                <asp:ListItem>54</asp:ListItem>
                                                <asp:ListItem>55</asp:ListItem>
                                                <asp:ListItem>56</asp:ListItem>
                                                <asp:ListItem>57</asp:ListItem>
                                                <asp:ListItem>58</asp:ListItem>
                                                <asp:ListItem>59</asp:ListItem>
                                                <asp:ListItem>60</asp:ListItem>
                                                <asp:ListItem>61</asp:ListItem>
                                                <asp:ListItem>62</asp:ListItem>
                                                <asp:ListItem>63</asp:ListItem>
                                                <asp:ListItem>64</asp:ListItem>
                                                <asp:ListItem>65</asp:ListItem>
                                                <asp:ListItem>66</asp:ListItem>
                                                <asp:ListItem>67</asp:ListItem>
                                                <asp:ListItem>68</asp:ListItem>
                                                <asp:ListItem>69</asp:ListItem>
                                                <asp:ListItem>70</asp:ListItem>
                                                <asp:ListItem>71</asp:ListItem>
                                                <asp:ListItem>72</asp:ListItem>
                                                <asp:ListItem>73</asp:ListItem>
                                                <asp:ListItem>74</asp:ListItem>
                                                <asp:ListItem>75</asp:ListItem>
                                                <asp:ListItem>76</asp:ListItem>
                                                <asp:ListItem>77</asp:ListItem>
                                                <asp:ListItem>78</asp:ListItem>
                                                <asp:ListItem>79</asp:ListItem>
                                                <asp:ListItem>80</asp:ListItem>
                                                <asp:ListItem>81</asp:ListItem>
                                                <asp:ListItem>82</asp:ListItem>
                                                <asp:ListItem>83</asp:ListItem>
                                                <asp:ListItem>84</asp:ListItem>
                                                <asp:ListItem>85</asp:ListItem>
                                                <asp:ListItem>86</asp:ListItem>
                                                <asp:ListItem>87</asp:ListItem>
                                                <asp:ListItem>88</asp:ListItem>
                                                <asp:ListItem>89</asp:ListItem>
                                                <asp:ListItem>90</asp:ListItem>
                                                <asp:ListItem>91</asp:ListItem>
                                                <asp:ListItem>92</asp:ListItem>
                                                <asp:ListItem>93</asp:ListItem>
                                                <asp:ListItem>94</asp:ListItem>
                                                <asp:ListItem>95</asp:ListItem>
                                                <asp:ListItem>96</asp:ListItem>
                                                <asp:ListItem>97</asp:ListItem>
                                                <asp:ListItem>98</asp:ListItem>
                                                <asp:ListItem>99</asp:ListItem>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Message Text" SortExpression="MessageText">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Height="127px" Style="float: left" Text='<%# Bind("MessageText") %>'
                                                TextMode="MultiLine" Width="323px"></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("MessageText") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="GroupItemId" InsertVisible="False" SortExpression="GroupItemId"
                                        Visible="False">
                                        <EditItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("GroupItemId") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("GroupItemId") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <EditRowStyle BackColor="#999999" />
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                            </asp:GridView>
                            <p />
                            <asp:Label ID="Label8" runat="server" Text="Be sure to click &quot;Save&quot; to save your messages and the sequence in which they will be sent."></asp:Label>
                            <p />
                            <br />
                            <asp:Button ID="Button8" runat="server" Text="Save  Messages" CausesValidation="false" />
                            <asp:Label ID="Label5" runat="server" Text=""></asp:Label>
                            <asp:SqlDataSource ID="SQLv_UserContentMessageGroupItem_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                SelectCommand="usp_UserContentMessageGroupItemById" SelectCommandType="StoredProcedure"
                                DeleteCommand="usp_UserSavedMessageGroupItemDelete" DeleteCommandType="StoredProcedure"
                                InsertCommand="usp_UserSavedMessageGroupItemInsert" InsertCommandType="StoredProcedure"
                                UpdateCommand="usp_UserSavedMessageGroupItemUpdate" UpdateCommandType="StoredProcedure">
                                <DeleteParameters>
                                    <asp:Parameter Name="Id" Type="Int32" />
                                </DeleteParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="MessageGroupId" Type="Int32" />
                                    <asp:Parameter Name="SeqNo" Type="Byte" />
                                    <asp:Parameter Name="MessageText" Type="String" />
                                    <asp:Parameter Name="Active" Type="Boolean" />
                                </InsertParameters>
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="GridView1" Name="Id" PropertyName="SelectedValue"
                                        Type="Int32" />
                                </SelectParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="Id" Type="Int32" />
                                    <asp:Parameter Name="MessageGroupId" Type="Int32" />
                                    <asp:Parameter Name="SeqNo" Type="Byte" />
                                    <asp:Parameter Name="MessageText" Type="String" />
                                    <asp:Parameter Name="Active" Type="Boolean" />
                                </UpdateParameters>
                            </asp:SqlDataSource>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
                &nbsp;
            </td>
            <td class="style2" valign="top">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:Panel ID="Panel3" runat="server" Style="display: none" CssClass="modalPopup">
                    <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
                    --%>
                    <asp:Button ID="Button3" runat="server" CausesValidation="false" Style="float: right;
                        background-color: #FF0000;" Text="X" />
                    <h2>
                        <asp:Label ID="Label3" runat="server" Text="Reference Templates"></asp:Label>
                    </h2>
                    <asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <table>
                                <tr>
                                    <td valign="top">
                                        Message:
                                    </td>
                                    <td valign="top" style="text-align: left" class="style3">
                                        <asp:TextBox ID="TextBox2" runat="server" Height="127px" TextMode="MultiLine" Width="323px"
                                            Style="float: left"></asp:TextBox>
                                        <asp:Button ID="Button4" runat="server" CausesValidation="false" Text="Insert" Style="float: left" />
                                        <asp:Button ID="Button5" runat="server" CausesValidation="false" Text="Update" Style="float: left;
                                            display: none" />
                                        <asp:Label ID="Label4" runat="server" Text=""></asp:Label>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td class="style3">
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <asp:Button ID="Button6" runat="server" Style="display: none;" Text="Button" />
                    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
                        DropShadow="true" DynamicServicePath="" Enabled="True" PopupControlID="Panel3"
                        TargetControlID="Button6">
                    </asp:ModalPopupExtender>
                </asp:Panel>
                &nbsp;
                <%--        <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup">
                --%>
                <asp:Panel ID="pnlNewContentSuccess" runat="server" CssClass="modalPopup">
                    <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
                    --%>
                    <asp:Button ID="btnCancel" runat="server" CausesValidation="false" Style="float: right;
                        background-color: #FF0000;" Text="X" />
                    <h2>
                        <asp:Label ID="lblAction" runat="server" Text="Reference Templates"></asp:Label>
                    </h2>
                    <table style="width: 100%;">
                        <tr>
                            <td valign="top">
                                Group Name:
                            </td>
                            <td valign="top">
                                <asp:TextBox ID="txtGroupName" runat="server" Width="160px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtGroupName"
                                    ErrorMessage="Enter the Name of the Message Group."></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                Type of List:
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="MessageTypeODS"
                                    DataTextField="Name" DataValueField="Id">
                                </asp:DropDownList>
                                <asp:ObjectDataSource ID="MessageTypeODS" runat="server" OldValuesParameterFormatString="original_{0}"
                                    SelectMethod="GetData" TypeName="LogginsLogDSTableAdapters.usp_lkp_MessageTypeSelect_ALLTableAdapter">
                                </asp:ObjectDataSource>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="btnInsert" runat="server" Text="Insert" />
                                <asp:Button ID="btnUpdate" runat="server" Text="Update" />
                                <asp:Label ID="Label2" runat="server" Text="" Visible="false"></asp:Label>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                    <asp:Button ID="btnNewCotentSuccess" runat="server" Style="display: none;" Text="Button" />
                    <asp:ModalPopupExtender ID="InsertPopupExtender" runat="server" BackgroundCssClass="modalBackground"
                        DropShadow="true" DynamicServicePath="" Enabled="True" PopupControlID="pnlNewContentSuccess"
                        TargetControlID="btnNewCotentSuccess">
                    </asp:ModalPopupExtender>
                </asp:Panel>
            </td>
            <td>
            </td>
            <td class="style2">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
                <asp:Panel ID="Panel5" runat="server" Style="display: none" CssClass="modalPopup">
                    <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
                    --%>
                    <asp:Button ID="Button11" runat="server" CausesValidation="false" Style="float: right;
                        background-color: #FF0000;" Text="X" />
                    <h2>
                        <asp:Label ID="Label7" runat="server" Text="Reference Templates"></asp:Label>
                    </h2>
                    <table style="width: 100%;">
                        <tr>
                            <td valign="top" colspan="3">
                                Use these System Templates as a source for your own messages
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" valign="top">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                        <asp:Panel ID="Panel1" runat="server">
                                            Search by Name
                                            <br />
                                            <asp:DropDownList ID="ddlSystemMessageGroup" runat="server" AppendDataBoundItems="True"
                                                AutoPostBack="True" CausesValidation="False" DataSourceID="SqlSystemMessageGroupDDL_ds"
                                                DataTextField="GroupName" DataValueField="Id" Width="200px">
                                                <asp:ListItem Value="0">Please Select a Template …</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:SqlDataSource ID="SqlSystemMessageGroupDDL_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                                SelectCommand="usp_SystemMessageGroupName_DDL" SelectCommandType="StoredProcedure">
                                            </asp:SqlDataSource>
                                            <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                                DataSourceID="Sqlv_SystemMessageGroup_ds" ForeColor="#333333" GridLines="None"
                                                Width="405px">
                                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                                <Columns>
                                                    <asp:BoundField DataField="SeqNo" HeaderText=" # " ReadOnly="True" SortExpression="SeqNo" />
                                                    <asp:BoundField DataField="MessageText" HeaderText="Message Text" ReadOnly="True"
                                                        SortExpression="MessageText" />
                                                </Columns>
                                                <EditRowStyle BackColor="#999999" />
                                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                                                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                                                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                                                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                                            </asp:GridView>
                                            <asp:SqlDataSource ID="Sqlv_SystemMessageGroup_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                                SelectCommand="usp_SystemContentMessageGroupItemById" SelectCommandType="StoredProcedure">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSystemMessageGroup" Name="Id" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                            <asp:Panel ID="Panel4" runat="server">
                                                <br />
                                                Copy the selected Group To Your List of Messages<br />
                                                <asp:Button ID="Button1" runat="server" CausesValidation="false" Text="Copy To Your Messages" />
                                                <asp:Label ID="Label6" runat="server" Text=""></asp:Label>
                                            </asp:Panel>
                                        </asp:Panel>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                    <asp:Button ID="Button14" runat="server" Style="display: none;" Text="Button" />
                    <asp:ModalPopupExtender ID="Panel5_ModalPopupExtender" runat="server" BackgroundCssClass="modalBackground"
                        DropShadow="true" DynamicServicePath="" Enabled="True" PopupControlID="Panel5"
                        TargetControlID="Button14">
                    </asp:ModalPopupExtender>
                </asp:Panel>
            </td>
            <td>
                &nbsp;
            </td>
            <td valign="top" class="style2">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td class="style2">
                &nbsp;
            </td>
        </tr>
    </table>
    <br />
</asp:Content>
